package eit.service.impl;

import eit.model.Issue;
import eit.service.IssueService;
import eit.dao.IssueDAO;
import eit.dao.ProjectDAO;
import eit.dao.TagDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;


/**
 *
 * @author acoustic
 */

@Service
public class IssueServiceImpl implements IssueService
{
	@Autowired
	private IssueDAO issueDAO ;
	
	@Autowired
	private TagDAO tagDAO ;
	
	@Autowired
	private ProjectDAO projectDAO;

	@Override
	public Issue loadIssue(int _ID)
	{
		Issue returnIssue = issueDAO.get(_ID) ;
		
		returnIssue.setTagList(tagDAO.getTagsByIssueID(_ID));
		
		returnIssue.setProject(projectDAO.getProjectByIssueID(_ID));
		
		return returnIssue ;
	}

	@Override
	public void changeIssue(Issue _Issue)
	{
		throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
	}

	@Override
	public void createIssue(Issue _Issue)
	{
		throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
	}
	
	
	
	
}
